// pages/bills/bills.js
Page({

  /**
   * Page initial data
   */
  data: {
    bills: [{
      billType: 0,
      billAmount: '20.0',
      billTime: '2022-04-22',
      billBelongCard: '62222218'
    }]

  },

  /**
   * Lifecycle function--Called when page load
   */
  onLoad(options) {
    var that =this
    var {cardNumber} =options
    console.log('卡号是：'+cardNumber)
    var myCardNumber =cardNumber
    // 加载当前学生的账单
    var app= getApp()
    wx.request({
      url: app.globalData.baseUrl + '/bill/getByNumber',
      method:'post',
      data: {
        cardNumber: myCardNumber
      },
      success(res){
        console.log('获取账单成功')
        console.log(res)
        that.setData({
          bills: res.data
        })
        



      }
    })

  },

  /**
   * Lifecycle function--Called when page is initially rendered
   */
  onReady() {

  },

  /**
   * Lifecycle function--Called when page show
   */
  onShow() {

  },

  /**
   * Lifecycle function--Called when page hide
   */
  onHide() {

  },

  /**
   * Lifecycle function--Called when page unload
   */
  onUnload() {
    

  },

  /**
   * Page event handler function--Called when user drop down
   */
  onPullDownRefresh() {

  },

  /**
   * Called when page reach bottom
   */
  onReachBottom() {

  },

  /**
   * Called when user click on the top right corner to share
   */
  onShareAppMessage() {

  }
})